package com.cloudlead.fleetAction.action;

import com.cloudlead.common.lang.annotation.Label;
import com.cloudlead.common.worker.action.impl.AbstractActionFactory;
import com.cloudlead.common.worker.annotation.Action;
import com.cloudlead.common.worker.annotation.Order;
import com.cloudlead.fleetAction.BusinessModules;
import com.cloudlead.fleetAction.service.BaseDoorEditSer;
import com.cloudlead.fleetService.BaseDoorEditService;
import com.cloudlead.fleetService.vo.BaseDoorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * Created by wyj on 2015/8/18.
 */
@Controller
public class BaseDoorEditActionFactory extends AbstractActionFactory implements BaseDoorEditService {
    public BaseDoorEditActionFactory() {
        super(BusinessModules.DoorManagement);
    }

    @Autowired
    BaseDoorEditSer baseDoorEditSer;
    @Override
    @Action
    @Order(1)
    @Label("列表查询")
    public List<BaseDoorVo> findAllDoor(BaseDoorVo vo) {
        return baseDoorEditSer.findAllDoor(vo);
    }

    @Override
    @Action
    @Order(2)
    @Label("门点删除")
    public String deleteDoor(String id) {
        return  baseDoorEditSer.deleteDoor(id);
    }

    @Override
    @Action
    @Order(1)
    @Label("门点增加")
    public String createDoor(@NotNull @Label("基本信息")BaseDoorVo vo) {
        return baseDoorEditSer.createDoor(vo);
    }

    @Override
    @Action
    @Order(3)
    @Label("门点编辑")
    public String editBaseDoor(@NotNull @Label("基本信息")BaseDoorVo vo){
        return baseDoorEditSer.editBaseDoor(vo);
    }
}
